/* GUI */
if CLIENT then
	GUIMenus = {}
	
	//Client version
	function OpenGUI(id, args)
		if not GUIMenus[id]["callback"] then
			print("Cannot find GUI with id")
			return
		end
		
		GUIMenus[id]["callback"](args)
	end

	function AddGUI(name, callback)
		table.insert(GUIMenus, {name = name, callback = callback})
		return #GUIMenus
	end

	local files = file.Find("../gamemodes/"..GM.FolderName.."/gamemode/gui/*.lua")
	for k, v in pairs(files) do
		include("gui/" .. v)
	end
end

if not SERVER then return end

//Server version
function OpenGUI(ply, id)
	//Send the LUA code to open the gui
	ply:SendLua("OpenGUI(" .. id .. ")")
end